package cn.edu.lzzy.vm;


import cn.edu.lzzy.entities.Applicant;

import lombok.Getter;
import lombok.Setter;

import java.util.Date;
import java.util.UUID;

@Setter
@Getter
public class VmApplicant {
    private UUID id;
    private final int status;
    private final Date applyTime;
    private final UUID courseId;
    private final String courseName;
    private final String courseDesc;
    private final String courseCover;
    private final Date createTime;
    private final Date updateTime;

    private final String teacherName;
    private final String teacherAvatar;
    private final String studentName;
    private final String studentAvatar;



    public VmApplicant(Applicant applicant){
        id=applicant.getId();
        status=applicant.getStatus();
        applyTime=applicant.getApplyTime();
        courseId=applicant.getCourse().getId();
        courseName=applicant.getCourse().getName();
        courseDesc=applicant.getCourse().getDescription();
        courseCover=applicant.getCourse().getCover();
        createTime=applicant.getCourse().getCreateTime();
        updateTime=applicant.getCourse().getUpdateTime();

        teacherName=applicant.getCourse().getTeacher().getUserName();
        teacherAvatar=applicant.getCourse().getTeacher().getAvatar();

        studentName=applicant.getStudent().getUserName();
        studentAvatar=applicant.getStudent().getAvatar();
    }
}